#include "head.h"
/*
typedef enum {
    id = 0,
    file_name,
    uid,
    pre_dir,
    path,
    file_type,
    hash,
    create_time
} fileskey;

typedef enum {
    user_uid = 0,
    user_name,
    dir_id,
    psw_hash,
    salt_value,
    islogin,
    regis_date,
    isDel
} userkey;
*/

config_data *config;

int package(char *str){
    char t[100] = {0};
    strcpy(t, "\"");
    strcat(t, str);
    strcat(t, "\"");
    strcpy(str, t);
    return 0;
}

bool getConfig(){
    config = (config_data*)calloc(1, sizeof(config_data));
    printf("!!!\n");
    getparameter("ip", config->ip);
    getparameter("port", config->port);
    getparameter("rootpath", config->rootpath);
    getparameter("mysql_host", config->mysql_host);
    getparameter("mysql_user", config->mysql_user);
    getparameter("mysql_passwd", config->mysql_passwd);
    getparameter("mysql_db", config->mysql_db);
    getparameter("mysql_port", config->mysql_port);
    getparameter("log", config->log);
    return true;
}
